package net.spider.tasks.sankaku;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import net.spider.dao.DB;

public class EndTask extends Thread {

	private static final Log log = LogFactory.getLog(EndTask.class);

	public void run() {
		DB.close();
		try {
			ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("trunk.dat"));
			out.writeObject(TrunkTask.QUEUE);
			out.close();
		} catch (IOException e) {
			log.error(e);
		}
		log.info("END");
	}

}
